<%@ Page Language="C#"%>
<%@ Import namespace="SubSonic.Utilities"%>
<%@ Import Namespace="SubSonic" %>
using System;
using System.Web.Profile;
using Medianamik.Core;
using Medianamik.Core.Profile;

namespace Medianamik.DummyWebSite.Website.Security
{
    public class MyProfile : UserProfile
    {
<%
    string[] defaultProperties = new string[] { "NodeId", "User",
        "FullName", "UICultureName", "LastLoginDate", "ExpirationDate",
        "Avatar", "Active", "WebSiteUrl", "Nickname", "SubscriptionDate",
        "Note", "EditorToolbarMode","EnableMultiLanguageFeatures",
        "MaySpecifyMedianamikLinkProtocol","MayManageOwnGroup", "WebSiteURL"};
    
    Medianamik.Core.NodeType profileType = Medianamik.Core.NodeTypeManager.GetNodeType(Medianamik.Core.MedianamikTypes.MedianamikProfile);

    foreach (Medianamik.Core.NodeTypeProperty property in profileType.GetAllProperties())
    {
        bool found =false;
        foreach (string s in defaultProperties)    
        {        
            if (s.Equals(property.Name))        
            {            
                found =true;            
                break;        
            }    
        }        
        if (!found)    
        {
            string cSharpString = Medianamik.Core.Sugar.DataUtil.GetCSharpTypeName(property);
        
            %>
            [SettingsAllowAnonymous(false)]
            [ProfileProvider(ProviderName.ProfileProviderName)]
            public <%= cSharpString%> <%= property.Name%>
            {
                get
                {
                    return (<%= cSharpString%>)base["<%= property.Name%>"];
                }
                set
                {
                    base["<%= property.Name%>"] = value;
                }
            }
            <%
        }
    }
%>
    }
}